package com.jjh.springframework.test.event;

import com.jjh.springframework.context.ApplicationEvent;

/**
 * CustomEvent
 * 创建一个自定义事件，在事件类的构造函数中可以添加自己的想要的入参信息。这个事件类最终会被完成的拿到监听里，所以你添加的属性都会被获得到。
 *
 * @author jjh
 * @date 2021/07/14
 **/
public class CustomEvent extends ApplicationEvent {

    private String id;
    private String message;


    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public CustomEvent(Object source, String id, String message) {
        super(source);
        this.id = id;
        this.message = message;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
